import type { getAuthApi, ResApi } from '@/types/auth'
import request from '@/utils/request'

// 获取权限列表
export const getAuthListApi = () => {
  return request<ResApi<getAuthApi[]>>({
    method: 'get',
    url: '/auth/index',
  })
}

// 添加权限
export const addAuthApi = (data: any) => {
  return request({
    method: 'post',
    url: '/auth/create',
    data,
  })
}

// 获取菜单权限接口
export const getAuthMenuApi = () => {
  return request({
    method: 'get',
    url: '/auth/menu',
  })
}
